{if $mail|@count eq 0}
    <p>Nessun messaggio</p>
{else}
    {foreach from=$mail item=message name=masseges}
        <table class="mess" width="600" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td align="center">
                        <table class="mess_top" width="100%">
                            <tbody>
                                <tr>
                                    <td id="title" class="small" align="left">
                                        {$message->title} ({$user_profile->checkUnreadPM($message->id_message)} messaggi non letti)
                                    </td>
                                    <td class="small" align="right">
                                        <!--
                                        <a href="profile.php?username={$user_profile->username}&action=mail&mode=delete&id={$message->id_message}">Elimina</a>
                                        <b>::</b>
                                        -->
                                        <a href="profile.php?username={$user_profile->username}&action=mail&mode=view&id={$message->id_message}">
                                            <b>Visualizza</b>
                                        </a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <table class="mess_bg" width="100%">
                            <tbody>
                                <tr>
                                    <td class="mess_text" align="left">
                                        Mittente:
                                        <a class="mess_text" href="profile.php?username={$message->sender}">{$message->sender}</a>
                                    </td>
                                    <td class="mess_text" align="right"> {Util::getDate($message->datetime)} alle {Util::getTime($message->datetime)}</td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
    {/foreach}
{/if}